package com.ruoyi.web.controller.app.controller;

import com.ruoyi.framework.web.exception.base.XResult;
import com.ruoyi.sj.domain.DynamicPermit;
import com.ruoyi.web.controller.app.service.AppDynamicPermitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName AppDynamicPermitController
 * @Description TODO
 * @Author tyc@yanyu
 * @Date 2018/12/29 0029 17:51
 **/
@RequestMapping("/app/permit")
@RestController
@Api(tags = "朋友圈权限")
public class AppDynamicPermitController {

    @Autowired
    private AppDynamicPermitService appDynamicPermitService;

    @PostMapping("addPermit")
    @ApiOperation(value = "添加朋友圈权限")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dynamicId", value = "动态id", required = true, dataType = "String", paramType = "query"),
           /* @ApiImplicitParam(name = "labelIds", value = "标签ID", required = false, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "userIds", value = "用户id", required = false, dataType = "String", paramType = "query")*/
            @ApiImplicitParam(name = "businessId", value = "用户id", required = false, dataType = "String", paramType = "query")
    })
    public XResult addPermit(String dynamicId,String businessId){
        return new XResult("操作成功",appDynamicPermitService.insertDynamicPermit(dynamicId,businessId));
    }
}
